//
//  UIImageView+Category.swift
//  WCSwiftDev
//
//  Created by ISSUSER on 2024/6/17.
//

import Foundation
import UIKit
import Kingfisher

extension UIImageView {
    
    // MARK: - 加载图片
    func setImage(urlStr: String, _ placeholderImage: String = "icon_idcard_confirm_info_bg") {
        if let url = URL(string: urlStr) {
            self.kf.setImage(with: url, placeholder: UIImage(named: placeholderImage))
        }else{
            self.image = UIImage(named: placeholderImage)
        }
//        let cache = KingfisherManager.shared.cache
//        cache.clearDiskCache()//清除硬盘缓存
//        cache.clearMemoryCache()//清理网络缓存
//        cache.cleanExpiredDiskCache()//清理过期的，或者超过硬盘限制大小的
    }
}
